{extend name='extra@admin/content'}
{block name="button"}

{/block}
{block name="content"}
<!-- 表单搜索 开始 -->
<form class="layui-form layui-form-pane form-search" action="__SELF__" onsubmit="return false" method="get">
    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">订单号</label>
        <div class="layui-input-inline">
            <input name="id" value="{$Think.get.id|default=''}" placeholder="请输入订单号" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">下单时间</label>
        <div class="layui-input-inline">
            <input name="date" id='range-date' value="{$Think.get.date|default=''}"
                   placeholder="请选择下单时间" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item layui-inline">
        <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
    </div>
</form>
<!-- 表单搜索 结束 -->
<form onsubmit="return false;" data-auto="true" method="post">
    {if empty($list)}
    <p class="help-block text-center well">没 有 记 录 哦！</p>
    {else}
    <input type="hidden" value="resort" name="action"/>
    <table class="layui-table" lay-skin="line" lay-size="sm">
        <thead>
            <tr>
                <th class='text-left nowrap'>ID</th>
                <th class='text-left nowrap'>订单号</th>
                <th class='text-left nowrap'>收货人姓名</th>
                <th class='text-left nowrap'>手机</th>
                <th class='text-left nowrap'>订单类型</th>
                <th class='text-left nowrap'>商品数量</th>
                <th class='text-left nowrap'>支付金额</th>
                <th class='text-left nowrap'>支付方式</th>
                <th class='text-left nowrap'>订单状态</th>
                <th class='text-left nowrap'>操作</th>
            </tr>
        </thead>
        <tbody>
            {volist name='list' id='vo'}
            <tr>
                <td class='text-left nowrap'>
                    {$vo.id}
                </td>
                <td class='text-left nowrap'>
                    {$vo.order_sn}<br/>
                    {if condition="$vo.total gt 0"}
                    <span class="layui-badge">有退款申请 {$vo.total}</span>
                    {/if}
                    {if condition="$vo.total gt $vo.count"}
                    <span class="layui-badge"><?php echo $vo['total']-$vo['count'];?>个未处理</span>
                    {elseif condition="($vo.total eq $vo.count) AND ($vo.total gt 0)" /}
                    <span class="layui-badge">已处理</span>
                    {/if}
                </td>
                <td class='text-left nowrap'>
                    {$vo.realname}
                </td>
                <td class='text-left nowrap'>
                    {$vo.mobile}
                </td>
                <td class='text-left nowrap'>
                    {if condition="$vo.order_type eq 1"}
                    线上
                    {else /}
                    线下
                    {/if}
                </td>
                <td class='text-left nowrap'>
                    {$vo.goods_num}
                </td>
                <td class='text-left nowrap'>
                    {$vo.final_amount}
                </td>
                <td class='text-left nowrap'>
                    {if condition="$vo.pay_status eq 1"}
                    {if condition="$vo.pay_type eq 1"}
                    支付宝
                    {elseif condition="$vo.pay_type eq 2"}
                    微信支付
                    {elseif condition="$vo.pay_type eq 3"}
                    余额
                    {/if}
                    {else}
                    未支付
                    {/if}
                </td>
                <td class='text-left nowrap'>
                    {if condition="$vo.order_status eq 0"}未支付
                    {elseif condition="$vo.order_status eq 1"}已支付
                    {elseif condition="$vo.order_status eq 2"}已确认
                    {elseif condition="$vo.order_status eq 3"}已发货
                    {elseif condition="$vo.order_status eq 4"}已收货
                    {elseif condition="$vo.order_status eq 5"}退货申请中
                    {elseif condition="$vo.order_status eq 6"}退货已处理
                    {elseif condition="$vo.order_status eq 7"}订单已完成
                    {/if}
                </td>
                <td class='text-left nowrap'>
                    {if auth("$classuri/detail")}
                    <span class="text-explode">|</span>
                    <a data-open='{:url("$classuri/detail")}?id={$vo.id}' href="javascript:void(0)">详情</a>
                    {/if}
                </td>
            </tr>
            {/volist}
        </tbody>
    </table>
    {if isset($page)}<p>{$page}</p>{/if}
    {/if}
    <script>
        window.laydate.render({range: true, elem: '#range-date', format: 'yyyy/MM/dd'});
    </script>
</form>
{/block}